package com.zz.study.sharding.mappers;

import com.zz.study.sharding.entity.DtFusdataFlink;
import com.zz.study.sharding.entity.DtFusdataFlinkSimple;
import com.zz.study.sharding.entity.TrackdataHisTest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * created by xjx on  2024-01-25 10:59
 */
@Mapper
public interface TrackdataHisTestMapper {

    Map<String,Object> getHisMinMaxInfo();

    Long getHisRecordsCountByRange(@Param("min") long min, @Param("max") long max);


    List<Map<String,Object>> getHisRecordsByRange(@Param("min") long min, @Param("max") long max);


    Long getHisRecordsCount();

    List<String> distinctMMSI(@Param("tableName") String tableName);

    List<String> distinctTarID(@Param("tableName") String tableName);

    List<String> distinctTarIDByTimeArea(@Param("tableName") String tableName,@Param("startTime") Date startTime, @Param("endTime") Date endTime);


    List<DtFusdataFlink> getHisRangeDateRecords(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    List<DtFusdataFlinkSimple> getHisRangeDateRecordsSimple(@Param("startTime") Date startTime, @Param("endTime") Date endTime);


    List<DtFusdataFlink> getTrackByMMSIAndTime(@Param("mmsi") String mmsi,@Param("startTime") Date startTime,@Param("endTime") Date endTime  );


    List<DtFusdataFlinkSimple> getTrackByMMSIAndTimeSimple(@Param("mmsi") String mmsi,@Param("startTime") Date startTime,@Param("endTime") Date endTime  );

    List<DtFusdataFlinkSimple> getTrackByMMSIAndTimeSimpleSingle(@Param("tableName") String tableName,@Param("mmsi") String mmsi,@Param("startTime") Date startTime,@Param("endTime") Date endTime  );

    List<DtFusdataFlinkSimple> getTrackByMMSISimpleSingle(@Param("tableName") String tableName,@Param("mmsi") String mmsi);

}
